package org.ece.meteo.showalerte;


import org.osgi.service.event.Event;
import org.osgi.service.event.EventHandler;


public class ShowalerteImpl implements EventHandler {
	static final int ok		= 0;
	static final int hTemp 	= 1;
	static final int hWind 	= 2;
	static final int hHydro = 3;
	static final int lTemp 	= 4;
	
	
	/* print each alert coming from the subscribed service  ( "org/ece/meteo/alerte/*") */
	 public void handleEvent(Event event){
	    String reportTitle 	= (String) event.getProperty("title");
	    String reportPath 	= (String) event.getProperty("path"); // Not used at this time
	    String reportTime 	= (String) event.getProperty("time");
	    String reportData 	= (String) event.getProperty("data");
	    String reportType 	= (String) event.getProperty("type"); // Not used at this time
	
	    if(reportTitle != null){
	    	System.out.println("[" + reportTime + "] " + reportData + "\tFrom " + reportTitle);
	    }
	}
	
}
